{{include file="public/header" /}}

<!-- header top nav -->
{{include file="public/header_top_nav" /}}

<!-- search -->
{{include file="public/nav_search" /}}

<!-- header nav -->
{{include file="public/header_nav" /}}

<!-- goods category -->
{{include file="public/goods_category" /}}

<!-- 订单确认页面顶部钩子-开始 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
    <div class="plugins-tag">
        <span>plugins_view_buy_top</span>
    </div>
{{/if}}
{{if !empty($plugins_view_buy_top_data) and is_array($plugins_view_buy_top_data)}}
    {{foreach $plugins_view_buy_top_data as $hook}}
        {{if is_string($hook) or is_int($hook)}}
            {{$hook|raw}}
        {{/if}}
    {{/foreach}}
{{/if}}
<!-- 订单确认页面顶部钩子-结束 -->

<!-- content -->
<div class="am-container">
    <div class="link-list">
        <!-- 订单确认页面内部顶部钩子-开始 -->
        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
            <div class="plugins-tag">
                <span>plugins_view_buy_inside_top</span>
            </div>
        {{/if}}
        {{if !empty($plugins_view_buy_inside_top_data) and is_array($plugins_view_buy_inside_top_data)}}
            {{foreach $plugins_view_buy_inside_top_data as $hook}}
                {{if is_string($hook) or is_int($hook)}}
                    {{$hook|raw}}
                {{/if}}
            {{/foreach}}
        {{/if}}
        <!-- 订单确认页面内部顶部钩子-结束 -->
        <div class="address-container am-background-white am-radius am-margin-top-main">
            <!-- 销售+自提 -->
            {{if $common_site_type eq 4}}
                <div id="buy-items-tabs" data-am-tabs="{noSwipe: 1}" class="am-tabs buy-header-nav am-margin-top-0">
                    <ul class="am-avg-sm-2 am-tabs-nav am-cf am-nav am-nav-tabs am-tabs-short-border am-margin-0">
                        {{if !empty($buy_site_model_list) and is_array($buy_site_model_list)}}
                            {{foreach $buy_site_model_list as $v}}
                                <li {{if isset($base['site_model']) and $base['site_model'] eq $v['value']}}class="am-active"{{/if}}>
                                    <a href="javascript:;" data-value="{{$v.value}}">{{$v.name}}</a>
                                </li>
                            {{/foreach}}
                        {{/if}}
                    </ul>
                </div>
            {{/if}}
            
            <!-- 快递 - 用户地址 -->
            {{if isset($base['site_model']) and $base['site_model'] eq 0}}
                <div id="buy-items-address" class="address user-address-container address-phone-padding">
                    <div class="control am-margin-bottom-main">
                        <h3>
                            <span>{{:MyLang('buy.confirm_delivery_address_name')}}</span>
                            <button type="button" class="am-close am-fr mobile-address-close-submit">&times;</button>
                        </h3>
                        {{if !empty($user_address_list)}}
                            <button class="am-btn address-submit-save am-text-xs am-background-white am-color-main am-border-main am-radius" type="button" data-url="{{:MyUrl('index/useraddress/saveinfo')}}">{{:MyLang('buy.use_new_address_name')}}</button>
                            {{/if}}
                    </div>
                    {{if !empty($user_address_list)}}
                        <ul class="address-list address-express-delivery am-margin-top-main">
                            {{foreach $user_address_list as $address}}
                                <li class="address-cart am-radius am-border-grey am-shadow {{if (isset($params['address_id']) and $params['address_id'] eq $address['id']) or (!isset($params['address_id']) and isset($address['is_default']) and $address['is_default'] eq 1) or (count($user_address_list) eq 1)}}address-default{{/if}}" id="data-list-{{$address.id}}" data-value="{{$address.id}}">
                                    <div class="address-content am-background-white">
                                        <div class="address-left">
                                            <div class="user-base am-border-bottom-grey-light am-color-grey-dark">
                                                {{if !empty($address.alias)}}
                                                    <span class="address-alias am-text-truncate am-badge am-badge-secondary-plain am-radius am-margin-right-xs">{{$address.alias}}</span>
                                                {{/if}}
                                                {{if isset($address['is_default']) and $address['is_default'] eq 1}}
                                                    <span class="address-alias am-badge am-radius am-margin-right-sm am-background-white am-border-grey-dark am-color-grey-dark">{{:MyLang('default_title')}}</span>
                                                {{/if}}
                                                <span class="address-detail">   
                                                    <span class="user am-text-truncate am-margin-right-sm">{{$address.name}}</span>
                                                    <span class="phone">{{$address.tel}}</span>
                                                </span>
                                            </div>
                                            <div class="region am-margin-bottom-sm am-margin-top-sm am-color-grey-dark">
                                                <span class="province">{{$address.province_name}}</span>
                                                <span class="city">{{$address.city_name}}</span>
                                                <span class="dist">{{$address.county_name}}</span>
                                                <span class="street">{{$address.address}}</span>
                                            </div>
                                        </div>
                                        <div class="address-right">
                                            <span class="am-icon-angle-right am-icon-md"></span>
                                        </div>
                                        <div class="address-operation-btn">
                                            {{if isset($address['is_default']) and $address['is_default'] neq 1}}
                                                <a href="javascript:;" class="address-default-submit am-padding-left-sm" data-url="{{:MyUrl('index/useraddress/setdefault')}}" data-id="{{$address.id}}" data-view="reload"> {{:MyLang('setup_default_title')}}</a>
                                            {{/if}}
                                            <a href="javascript:;" class="address-submit-save am-padding-left-sm" data-url="{{:MyUrl('index/useraddress/saveinfo', ['id'=>$address['id']])}}"> {{:MyLang('edit_title')}}</a>
                                            <a href="javascript:;" class="address-submit-delete am-padding-left-sm" data-url="{{:MyUrl('index/useraddress/delete')}}" data-id="{{$address.id}}"> {{:MyLang('delete_title')}}</a>
                                        </div>
                                    </div>
                                </li>
                            {{/foreach}}
                        </ul>
                    {{else /}}
                            <div class="am-text-center">
                                {{:ModuleInclude('public/not_data', [
                                    'msg'         => MyLang('buy.no_address_info_tips'),
                                    'icon'        => $attachment_host.'/static/common/images/no-address.png',
                                ])}}
                            <button class="am-btn am-text-xs am-background-white am-color-main am-border-main am-radius am-margin-bottom-main address-submit-save" type="button" data-url="{{:MyUrl('index/useraddress/saveinfo')}}">{{:MyLang('buy.use_new_address_name')}}</button>
                        </div>
                    {{/if}}
                </div>
            {{/if}}

            <!-- 自提点 - 自提地址 -->
            {{if isset($base['site_model']) and $base['site_model'] eq 2}}
                <div id="buy-items-address" class="address extraction-address-container address-phone-padding">
                    <div class="control am-margin-bottom-main">
                        <h3>{{:MyLang('buy.confirm_extraction_address_name')}}</h3>
                    </div>
                    {{if empty($base['extraction_address'])}}
                        <p class="am-text-danger am-text-center am-margin-top-lg">{{:MyLang('buy.no_take_address_tips')}}</p>
                    {{else /}}
                        <!-- 选中地址 -->
                        {{if !empty($base['address'])}}
                            <div class="am-panel am-panel-default extraction-default am-border-0 am-margin-0">
                                <div class="extraction-address-item am-cf">
                                    <div class="am-vertical-align-middle extraction-address-content">
                                        <div class="extraction-address-content-left">
                                            {{if !empty($base['address']['alias'])}}
                                                <span class="am-badge am-badge-secondary-plain am-radius am-margin-right-xs">{{$base.address.alias}}</span>
                                            {{/if}}
                                            <span class="am-margin-right-xs">{{$base.address.name}}</span>
                                            <span class="am-margin-right-xs">{{$base.address.tel}}</span>
                                            <p class="address-detail am-color-grey-dark">
                                                <span>{{$base.address.province_name}}</span>
                                                <span>{{$base.address.city_name}}</span>
                                                <span>{{$base.address.county_name}}</span>
                                                <span>{{$base.address.address}}</span>
                                            </p>
                                        </div>
                                        {{if !empty($base['address'])}}
                                            <button type="button" class="am-btn am-radius extraction-address-content-right am-border-main am-color-main am-text-xs am-background-white" data-am-modal="{target: '#extraction-address-popup'}">{{:MyLang('buy.choice_take_address_name')}}</button>
                                        {{/if}}
                                    </div>
                                    <div class="address-right address-position-top">
                                        <span class="am-icon-angle-right am-icon-md"></span>
                                    </div>
                                </div>
                            </div>
                        {{else /}}
                            <div class="am-text-center">
                                {{:ModuleInclude('public/not_data', [
                                    'msg'         => MyLang('buy.no_address_info_tips'),
                                    'icon'        => $attachment_host.'/static/common/images/no-address.png',
                                ])}}
                                <button type="button" class="am-btn am-text-xs am-background-white am-color-main am-border-main am-radius am-margin-bottom-main" data-am-modal="{target: '#extraction-address-popup'}">{{:MyLang('buy.choice_take_address_name')}}</button>
                            </div>
                        {{/if}}

                        <!-- 自提地址选择弹层 -->
                        <div class="am-popup" id="extraction-address-popup">
                            <div class="am-popup-inner">
                                <div class="am-popup-hd">
                                <h4 class="am-popup-title">{{:MyLang('buy.extraction_list_choice_title')}}</h4>
                                <span class="am-close" data-am-modal-close>&times;</span>
                                </div>
                                <div class="am-popup-bd">
                                    <ul class="am-list">
                                        {{foreach $base.extraction_address as $key=>$address}}
                                            <li class="extraction-address-item am-nbfc extraction-phone-address" data-value="{{$key}}">
                                                {{if !empty($address['logo'])}}
                                                    <div class="am-margin-right-xs extraction-phone-address-img">
                                                        <img src="{{$address.logo}}" alt="{{$address.name}}" class="am-img-thumbnail am-radius address-logo" />
                                                    </div>
                                                {{/if}}
                                                <div class="extraction-phone-address-content">
                                                    <div class="extraction-phone-address-content-title">
                                                        <p class="am-color-black extraction-phone-address-title">
                                                            {{if !empty($address['alias'])}}
                                                                <span class="am-badge am-badge-secondary-plain am-radius am-margin-right-sm">{{$address.alias}}</span>
                                                            {{/if}}
                                                            <span class="am-margin-right-sm">{{$address.name}}</span>
                                                            <span class="am-margin-right-sm">{{$address.tel}}</span>
                                                        </p>
                                                        <p class="address-detail am-color-grey-dark am-margin-bottom-sm am-margin-top-sm">
                                                            <span>{{$address.province_name}}</span>
                                                            <span>{{$address.city_name}}</span>
                                                            <span>{{$address.county_name}}</span>
                                                            <span>{{$address.address}}</span>
                                                            {{if isset($address['lng']) and isset($address['lat']) and $address['lng'] neq 0 and $address['lat'] neq 0}}
                                                                <a href="javascript:;" class="am-badge am-radius am-icon-map-marker am-margin-left-main submit-map-popup am-background-white am-text-xs" data-lng="{{$address.lng}}" data-lat="{{$address.lat}}"> {{:MyLang('view_map_title')}}</a>
                                                            {{/if}}
                                                        </p>
                                                    </div>
                                                    {{if (isset($params['address_id']) and $params['address_id'] eq $key) or (!empty($base['address']) and $base.address.id eq $key)}}
                                                        <button type="button" class="am-btn am-radius am-color-grey-dark am-border-main am-background-grey am-text-xs" disabled>{{:MyLang('already_choice_title')}}</button>
                                                    {{else /}}
                                                        <button type="button" class="am-btn am-radius am-color-main am-border-main am-background-white am-text-xs" data-value="{{$key}}">{{:MyLang('choice_title')}}</button>
                                                    {{/if}}
                                                </div>
                                            </li>
                                        {{/foreach}}
                                    </ul>
                                </div>
                            </div>
                        </div>
                    {{/if}}
                </div>
            {{/if}}
        </div>
        <!-- 订单确认页面地址底部钩子-开始 -->
        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
            <div class="plugins-tag">
                <span>plugins_view_buy_address_bottom</span>
            </div>
        {{/if}}
        {{if !empty($plugins_view_buy_address_bottom_data) and is_array($plugins_view_buy_address_bottom_data)}}
            {{foreach $plugins_view_buy_address_bottom_data as $hook}}
                {{if is_string($hook) or is_int($hook)}}
                    {{$hook|raw}}
                {{/if}}
            {{/foreach}}
        {{/if}}
        <!-- 订单确认页面地址底部钩子-结束 -->

        <!-- 商品分组订单信息 -->
        <div class="buy-items am-background-white am-radius am-padding-main am-margin-top-main">
            <h3>{{:MyLang('buy.buy_item_order_title')}}</h3>
            {{if !empty($buy_goods)}}
                <div class="goods-group-lis am-margin-top-main">
                    <div class="am-panel am-radius am-border-0 am-margin-0">
                        <div class="am-panel-bd am-padding-0">
                            <!-- 商品明细 -->
                            <table class="am-table am-margin-0">
                                <thead>
                                    <tr>
                                        <th>{{:MyLang('buy.goods_list_thead_base')}}</th>
                                        <th class="am-hide-sm-only">{{:MyLang('buy.goods_list_thead_price')}}</th>
                                        <th class="am-hide-sm-only">{{:MyLang('buy.goods_list_thead_number')}}</th>
                                        <th class="am-hide-sm-only am-text-center">{{:MyLang('buy.goods_list_thead_total')}}</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {{foreach $buy_goods as $k=>$v}}
                                        {{if !empty($v['goods_items'])}}
                                            <!-- 加一个判断是否是最后一个，如果是则隐藏 -->
                                            {{if $k gt 0}}
                                                <tr>
                                                    <td colspan="4" class="am-padding-0">
                                                        <!-- 商品分割线 -->
                                                        <hr data-am-widget="divider" class="am-divider am-border-0 am-border-bottom-grey am-margin-top-sm am-margin-bottom-sm" />
                                                    </td>
                                                </tr>
                                            {{/if}}
                                            <tr>
                                                <td colspan="4">
                                                    <div class="am-panel-hd am-padding-0 warehouse-info">
                                                        <!-- 分组导航内部开始钩子-开始 -->
                                                        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                                                            <div class="plugins-tag">
                                                                <span>plugins_view_buy_group_nav_inside_begin</span>
                                                            </div>
                                                        {{/if}}
                                                        {{php}}
                                                            $hook_name = 'plugins_view_buy_group_nav_inside_begin';
                                                            $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'data'=>$v]);
                                                            if(!empty($hook_data) && is_array($hook_data))
                                                            {
                                                                foreach($hook_data as $hook)
                                                                {
                                                                    if(is_string($hook) || is_int($hook))
                                                                    {
                                                                        echo htmlspecialchars_decode($hook);
                                                                    }
                                                                }
                                                            }
                                                        {{/php}}
                                                        <!-- 分组导航内部开始钩子-结束 -->

                                                        <!-- 仓库信息 -->
                                                        <span class="warehouse-item-container">
                                                            {{if !empty($v['icon'])}}
                                                                {{if IsUrl($v['icon'])}}
                                                                    <img src="{{$v.icon}}" alt="{{$v.name}}" class="warehouse-icon" />
                                                                {{else /}}
                                                                    <i class="{{$v.icon}}"></i>
                                                                {{/if}}
                                                            {{/if}}
                                                            {{if empty($v['url'])}}
                                                                <span class="warehouse-name">{{$v.name}}</span>
                                                            {{else /}}
                                                                <a href="{{$v.url}}" target="_blank" class="text-deco-none">
                                                                    <span class="warehouse-name">{{$v.name}}</span>
                                                                </a>
                                                            {{/if}}
                                                            {{if !empty($v['alias'])}}<span class="am-badge am-badge-secondary-plain am-radius am-margin-left-sm">{{$v.alias}}</span>{{/if}}
                                                        </span>

                                                        <!-- 分组导航内部中间钩子-开始 -->
                                                        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                                                            <div class="plugins-tag">
                                                                <span>plugins_view_buy_group_nav_inside_middle</span>
                                                            </div>
                                                        {{/if}}
                                                        {{php}}
                                                            $hook_name = 'plugins_view_buy_group_nav_inside_middle';
                                                            $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'data'=>$v]);
                                                            if(!empty($hook_data) && is_array($hook_data))
                                                            {
                                                                foreach($hook_data as $hook)
                                                                {
                                                                    if(is_string($hook) || is_int($hook))
                                                                    {
                                                                        echo htmlspecialchars_decode($hook);
                                                                    }
                                                                }
                                                            }
                                                        {{/php}}
                                                        <!-- 分组导航内部中间钩子-结束 -->

                                                        <!-- 地理位置 -->
                                                        {{if isset($v['lng']) and isset($v['lat']) and $v['lng'] neq 0 and $v['lat'] neq 0}}
                                                            <div class="am-margin-left-sm">
                                                                <a href="javascript:;" class="am-radius am-icon-map-marker submit-map-popup am-background-white am-color-grey am-font-weight-400 am-text-xs am-margin-left-sm" data-lng="{{$v.lng}}" data-lat="{{$v.lat}}"> {{:MyLang('view_map_title')}}</a>
                                                            </div>
                                                        {{/if}}

                                                        <!-- 分组导航内部结束钩子-开始 -->
                                                        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                                                            <div class="plugins-tag">
                                                                <span>plugins_view_buy_group_nav_inside_end</span>
                                                            </div>
                                                        {{/if}}
                                                        {{php}}
                                                            $hook_name = 'plugins_view_buy_group_nav_inside_end';
                                                            $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'data'=>$v]);
                                                            if(!empty($hook_data) && is_array($hook_data))
                                                            {
                                                                foreach($hook_data as $hook)
                                                                {
                                                                    if(is_string($hook) || is_int($hook))
                                                                    {
                                                                        echo htmlspecialchars_decode($hook);
                                                                    }
                                                                }
                                                            }
                                                        {{/php}}
                                                        <!-- 分组导航内部结束钩子-结束 -->
                                                    </div>
                                                </td>
                                            </tr>
                                            {{foreach $v.goods_items as $goods}}
                                                <!-- 分组商品顶部钩子-开始 -->
                                                {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                                                    <div class="plugins-tag">
                                                        <span>plugins_view_buy_group_goods_inside_top</span>
                                                    </div>
                                                {{/if}}
                                                {{php}}
                                                    $hook_name = 'plugins_view_buy_group_goods_inside_top';
                                                    $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'data'=>$v]);
                                                    if(!empty($hook_data) && is_array($hook_data))
                                                    {
                                                        foreach($hook_data as $hook)
                                                        {
                                                            if(is_string($hook) || is_int($hook))
                                                            {
                                                                echo htmlspecialchars_decode($hook);
                                                            }
                                                        }
                                                    }
                                                {{/php}}
                                                <!-- 分组商品顶部钩子-结束 -->
                                                <tr id="data-list-{{$goods.id}}" data-id="{{$goods.id}}" data-goods-id="{{$goods.goods_id}}">
                                                    <td class="base">
                                                        <!-- 分组商品详情基础顶部钩子-开始 -->
                                                        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                                                            <div class="plugins-tag">
                                                                <span>plugins_view_buy_group_goods_base_top</span>
                                                            </div>
                                                        {{/if}}
                                                        {{php}}
                                                            $hook_name = 'plugins_view_buy_group_goods_base_top';
                                                            $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'data'=>$goods]);
                                                            if(!empty($hook_data) && is_array($hook_data))
                                                            {
                                                                foreach($hook_data as $hook)
                                                                {
                                                                    if(is_string($hook) || is_int($hook))
                                                                    {
                                                                        echo htmlspecialchars_decode($hook);
                                                                    }
                                                                }
                                                            }
                                                        {{/php}}
                                                        <!-- 分组商品详情基础顶部钩子-结束 -->
                                                        <div class="goods-detail">
                                                            <a href="{{$goods.goods_url}}" target="_blank">
                                                                <img class="am-border-grey-light am-radius" src="{{$goods.images}}">
                                                            </a>
                                                            <div class="goods-base">
                                                                <a href="{{$goods.goods_url}}" target="_blank" class="goods-title am-text-truncate-2">{{$goods.title}}</a>
                                                                {{if !empty($goods.spec)}}
                                                                    <ul class="goods-attr">
                                                                        {{foreach $goods.spec as $kspeck=>$spec}}
                                                                            <li>
                                                                                {{$spec.type}}:{{$spec.value}}
                                                                                {{if count($goods.spec) neq $kspeck+1}}，{{/if}}
                                                                            </li>
                                                                        {{/foreach}}
                                                                    </ul>
                                                                {{/if}}
                                                            </div>
                                                        </div>
                                                        <div class="wap-base am-show-sm-only">
                                                            {{if $goods['original_price'] gt 0}}
                                                                <span class="original-price">{{$currency_symbol}}{{$goods.original_price}}</span>
                                                            {{/if}}
                                                            <strong class="total-price-content">{{$currency_symbol}}{{$goods.price}}</strong>
                                                            <span class="wap-number">x{{$goods.stock}}</span>
                                                        </div>
                                                        <!-- 分组商品详情基础底部钩子-开始 -->
                                                        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                                                            <div class="plugins-tag">
                                                                <span>plugins_view_buy_group_goods_base_bottom</span>
                                                            </div>
                                                        {{/if}}
                                                        {{php}}
                                                            $hook_name = 'plugins_view_buy_group_goods_base_bottom';
                                                            $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'data'=>$goods]);
                                                            if(!empty($hook_data) && is_array($hook_data))
                                                            {
                                                                foreach($hook_data as $hook)
                                                                {
                                                                    if(is_string($hook) || is_int($hook))
                                                                    {
                                                                        echo htmlspecialchars_decode($hook);
                                                                    }
                                                                }
                                                            }
                                                        {{/php}}
                                                        <!-- 分组商品详情基础底部钩子-结束 -->
                                                    </td>
                                                    <td class="am-hide-sm-only">
                                                        {{if $goods['original_price'] gt 0}}
                                                            <p class="original-price">{{$currency_symbol}}{{$goods.original_price}}</p>
                                                        {{/if}}
                                                        <p>{{$currency_symbol}}{{$goods.price}}</p>
                                                    </td>
                                                    <td class="number am-hide-sm-only am-color-grey">
                                                        {{$goods.stock}} {{$goods.inventory_unit}}
                                                    </td>
                                                    <td class="total-price am-hide-sm-only am-color-grey-dark am-text-center">
                                                        <span>{{$currency_symbol}}</span><strong class="line-price total-price-content">{{$goods.total_price}}</strong>
                                                    </td>
                                                </tr>
                                            {{/foreach}}
                                            <tr>
                                                <td colspan="4">
                                                    <!-- 分组商品底部钩子-开始 -->
                                                    {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                                                        <div class="plugins-tag">
                                                            <span>plugins_view_buy_group_goods_inside_bottom</span>
                                                        </div>
                                                    {{/if}}
                                                    {{php}}
                                                        $hook_name = 'plugins_view_buy_group_goods_inside_bottom';
                                                        $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'data'=>$v, 'params'=>$params]);
                                                        if(!empty($hook_data) && is_array($hook_data))
                                                        {
                                                            foreach($hook_data as $hook)
                                                            {
                                                                if(is_string($hook) || is_int($hook))
                                                                {
                                                                    echo htmlspecialchars_decode($hook);
                                                                }
                                                            }
                                                        }
                                                    {{/php}}
                                                    <!-- 分组商品底部钩子-结束 -->

                                                    <!-- 扩展展示数据 -->
                                                    {{if !empty($v['order_base']['extension_data'])}}
                                                        <ul class="buy-extension-data">
                                                            {{foreach $v['order_base']['extension_data'] as $ext}}
                                                                <li class="am-margin-top-xs">
                                                                    <span class="extension-items-name">{{$ext.name}}:</span>
                                                                    <span class="extension-items-tips">{{$ext.tips}}</span>
                                                                </li>
                                                            {{/foreach}}
                                                        </ul>
                                                    {{/if}}
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="4" class="am-text-right am-text-bottom">
                                                    <!-- 含运费小计 -->
                                                    <div class="am-text-right">
                                                        {{if $v['order_base']['total_price'] neq $v['order_base']['actual_price']}}
                                                            <span class="original-price am-margin-right-sm">{{$currency_symbol}}{{$v.order_base.total_price}}</span>
                                                        {{/if}}
                                                        <span class="buy-point-discharge-sum">
                                                            <span>{{:MyLang('buy.goods_item_total_name')}}</span>
                                                            <span class="price">
                                                                <span>{{$currency_symbol}}</span><strong class="total-price-content line-price am-text-sm">{{$v.order_base.actual_price}}</strong>
                                                            </span>
                                                        </span>
                                                    </div>
                                                </td>
                                            </tr>
                                        {{else /}}
                                            <tr>
                                                <td colspan="4">
                                                    <div class="table-no">
                                                        <i class="am-icon-skyatlas am-icon-lg"></i>
                                                        <p>{{:MyLang('buy.not_goods_tips')}}</p>
                                                    </div>
                                                </td>
                                            </tr>
                                        {{/if}}
                                    {{/foreach}}
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            {{else /}}
                <div class="table-no">
                    <i class="am-icon-skyatlas am-icon-lg"></i>
                    <p>{{:MyLang('buy.not_goods_tips')}}</p>
                </div>
            {{/if}}
        </div>

        <!-- 订单确认页面分组商品底部钩子-开始 -->
        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
            <div class="plugins-tag">
                <span>plugins_view_buy_group_goods_bottom</span>
            </div>
        {{/if}}
        {{if !empty($plugins_view_buy_group_goods_bottom_data) and is_array($plugins_view_buy_group_goods_bottom_data)}}
            {{foreach $plugins_view_buy_group_goods_bottom_data as $hook}}
                {{if is_string($hook) or is_int($hook)}}
                    {{$hook|raw}}
                {{/if}}
            {{/foreach}}
        {{/if}}
        <!-- 订单确认页面分组商品底部钩子-结束 -->

        <div class="am-background-white am-radius am-padding-bottom-main">
            <div class="buy-pay-footer am-padding-main am-margin-top-main">
                <!-- 支付方式 -->
                {{if $base['actual_price'] gt 0 and $common_order_is_booking neq 1}}
                    <div id="buy-items-payment" class="buy-items">
                        <h3>{{:MyLang('buy.buy_item_payment_title')}}</h3>
                        <div class="business-list business-list-nbfc payment am-margin-top-main" data-field="payment_id">
                            {{if !empty($payment_list)}}
                                <ul class="am-avg-sm-2 am-avg-md-3 am-avg-lg-4 payment-list" data-is-required="1">
                                    {{foreach $payment_list as $payment}}
                                        <li data-value="{{$payment.id}}" class="am-padding-sm am-padding-left-main am-padding-right-main am-text-center {{if isset($params['payment_id']) and $params['payment_id'] eq $payment['id']}}selected{{/if}}">
                                            <div class="business-item am-nbfc am-padding-sm am-radius">
                                                {{if !empty($payment.logo)}}
                                                    <img class="am-margin-right-xs am-radius" src="{{$payment.logo}}" class="am-radius" />
                                                {{/if}}
                                                <span>{{$payment.name}}</span>
                                                <i class="iconfont icon-subscript"></i>
                                            </div>
                                        </li>
                                    {{/foreach}}
                                </ul>
                            {{/if}}
                        </div>
                        {{if empty($payment_list)}}
                            <div class="table-no">
                                <i class="am-icon-skyatlas am-icon-lg"></i>
                                <p>{{:MyLang('buy.not_payment_tips')}}</p>
                            </div>
                        {{/if}}
                    </div>
                {{/if}}

                <!-- 订单确认页面支付方式底部钩子-开始 -->
                {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                    <div class="plugins-tag">
                        <span>plugins_view_buy_payment_bottom</span>
                    </div>
                {{/if}}
                {{if !empty($plugins_view_buy_payment_bottom_data) and is_array($plugins_view_buy_payment_bottom_data)}}
                    {{foreach $plugins_view_buy_payment_bottom_data as $hook}}
                        {{if is_string($hook) or is_int($hook)}}
                            {{$hook|raw}}
                        {{/if}}
                    {{/foreach}}
                {{/if}}
                <!-- 订单确认页面支付方式底部钩子-结束 -->
            </div>

            <!-- 留言 -->
            <div class="buy-message am-padding-horizontal-main am-margin-top-sm">
                <div class="order-extra am-radius am-padding-bottom-xs">
                    <label>{{:MyLang('buy.user_message_title')}}</label>
                    <textarea type="text" class="memo-input" placeholder="{{:MyLang('buy.user_message_placeholder')}}"></textarea>
                </div>

                <!-- 订单确认页面用户留言底部钩子-开始 -->
                {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                    <div class="plugins-tag">
                        <span>plugins_view_buy_user_note_bottom</span>
                    </div>
                {{/if}}
                {{if !empty($plugins_view_buy_user_note_bottom_data) and is_array($plugins_view_buy_user_note_bottom_data)}}
                    {{foreach $plugins_view_buy_user_note_bottom_data as $hook}}
                        {{if is_string($hook) or is_int($hook)}}
                            {{$hook|raw}}
                        {{/if}}
                    {{/foreach}}
                {{/if}}
                <!-- 订单确认页面用户留言底部钩子-结束 -->
            </div>

            <div class="buy-nav-footer am-padding-horizontal-main">
                <!-- 订单确认页面订单确认信息顶部钩子-开始 -->
                {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                    <div class="plugins-tag">
                        <span>plugins_view_buy_base_confirm_top</span>
                    </div>
                {{/if}}
                {{if !empty($plugins_view_buy_base_confirm_top_data) and is_array($plugins_view_buy_base_confirm_top_data)}}
                    {{foreach $plugins_view_buy_base_confirm_top_data as $hook}}
                        {{if is_string($hook) or is_int($hook)}}
                            {{$hook|raw}}
                        {{/if}}
                    {{/foreach}}
                {{/if}}
                <!-- 订单确认页面订单确认信息顶部钩子-结束 -->

                <!-- 基础信息 -->
                <div class="buy-order-nav am-padding-top-sm am-background-white am-box-shadow-top">
                    <div class="box am-radius am-padding-main am-color-grey-dark am-margin-bottom-main am-border-grey am-radius">
                        <div class="base-real-pay">
                            <span class="buy-line-title">{{:MyLang('buy.summary_title')}}</span>
                            <span class="price">
                                <strong>{{$currency_symbol}}</strong><strong class="nav-total-price">{{$base.actual_price}}</strong>
                            </span>
                        </div>

                        <!-- 销售模式+自提模式 显示地址 -->
                        {{if in_array($common_site_type, [0,2,4]) and !empty($base['address'])}}
                            <div class="pay-address">
                                <div class="buy-footer-address">
                                    <span class="buy-line-title">{{:MyLang('buy.summary_contact_name')}}</span> 
                                    <span class="buy-user">
                                        {{if empty($base['address'])}}...{{else /}}{{$base.address.name}}{{/if}}
                                    </span>
                                    <span class="buy-phone">
                                        {{if empty($base['address'])}}...{{else /}}{{$base.address.tel}}{{/if}}
                                    </span>
                                </div>
                                <div class="buy-footer-address">
                                    <span class="buy-line-title buy-line-title-type">{{:MyLang('buy.summary_address')}}</span>
                                    <span class="buy-address-detail">
                                        {{if empty($base['address'])}}
                                            ...
                                        {{else /}}
                                            {{$base.address.province_name}} {{$base.address.city_name}} {{$base.address.county_name}} {{$base.address.address}}
                                        {{/if}}
                                    </span>
                                </div>
                            </div>
                        {{/if}}
                    </div>
                    <form class="am-form form-validation nav-buy" action="{{:MyUrl('index/buy/add')}}" method="post" class="nav-buy" request-type="ajax-fun" request-value="BuySubmitBack" data-site-type="{{$common_site_type}}" data-base-actual-price="{{$base.actual_price}}" data-is-booking="{{$common_order_is_booking}}">
                        <input type="hidden" name="buy_type" value="{{if isset($buy_data['buy_type'])}}{{$buy_data.buy_type}}{{else /}}goods{{/if}}" />
                        <input type="hidden" name="goods_data" value="{{if isset($buy_data['goods_data'])}}{{$buy_data.goods_data}}{{/if}}" />
                        <input type="hidden" name="ids" value="{{if isset($params['ids'])}}{{$params.ids}}{{/if}}" />
                        <input type="hidden" name="address_id" value="{{if isset($base['address']) and isset($base['address']['id'])}}{{$base.address.id}}{{else /}}{{if isset($params['address_id'])}}{{$params.address_id}}{{else /}}-1{{/if}}{{/if}}" />
                        <input type="hidden" name="payment_id" value="{{if isset($params['payment_id'])}}{{$params.payment_id}}{{else /}}0{{/if}}" />
                        <input type="hidden" name="user_note" value="" />
                        <input type="hidden" name="site_model" value="{{if isset($base['site_model'])}}{{$base.site_model}}{{else /}}0{{/if}}" />
                        <!-- 订单确认页面提交订单表单内部钩子-开始 -->
                        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                            <div class="plugins-tag">
                                <span>plugins_view_buy_form_inside</span>
                            </div>
                        {{/if}}
                        {{if !empty($plugins_view_buy_form_inside_data) and is_array($plugins_view_buy_form_inside_data)}}
                            {{foreach $plugins_view_buy_form_inside_data as $hook}}
                                {{if is_string($hook) or is_int($hook)}}
                                    {{$hook|raw}}
                                {{/if}}
                            {{/foreach}}
                        {{/if}}
                        <!-- 订单确认页面提交订单表单内部钩子-结束 -->
                        <div class="go-btn-wrap">
                            <button type="submit" class="am-btn am-btn-primary am-btn-lg am-radius btn-loading-example buy-submit" data-am-loading="{spinner: 'circle-o-notch', loadingText:'{{:MyLang('buy.summary_submit_order_name')}}'}">
                                <i class="am-icon-check"></i>
                                <span>{{:MyLang('buy.summary_submit_order_name')}}</span>
                            </button>
                        </div>
                    </form>
                </div>

                <!-- 订单确认页面内部底部钩子-s开始 -->
                {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                    <div class="plugins-tag">
                        <span>plugins_view_buy_inside_bottom</span>
                    </div>
                {{/if}}
                {{if !empty($plugins_view_buy_inside_bottom_data) and is_array($plugins_view_buy_inside_bottom_data)}}
                    {{foreach $plugins_view_buy_inside_bottom_data as $hook}}
                        {{if is_string($hook) or is_int($hook)}}
                            {{$hook|raw}}
                        {{/if}}
                    {{/foreach}}
                {{/if}}
                <!-- 订单确认页面内部底部钩子-结束 -->

            </div>
        </div>
    </div>
</div>

<!-- 订单确认页面底部钩子-开始 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
    <div class="plugins-tag">
        <span>plugins_view_buy_bottom</span>
    </div>
{{/if}}
{{if !empty($plugins_view_buy_bottom_data) and is_array($plugins_view_buy_bottom_data)}}
    {{foreach $plugins_view_buy_bottom_data as $hook}}
        {{if is_string($hook) or is_int($hook)}}
            {{$hook|raw}}
        {{/if}}
    {{/foreach}}
{{/if}}
<!-- 订单确认页面底部钩子-结束 -->

<!-- 订单提交后提示弹层 -->
<div class="am-modal am-modal-no-btn" tabindex="-1" id="buy-order-submit-modal">
    <div class="am-modal-dialog">
        <div class="am-modal-bd">
            <div class="content am-vertical-align-middle am-padding-vertical-sm am-text-xs">
                <p class="am-text-success">{{:MyLang('buy.payment_layer_title')}}</p>
                <p class="am-text-warning am-margin-top-lg">{{:MyLang('buy.payment_layer_content')}}</p>
                <p class="am-text-warning am-margin-xs">
                    <span>{{:MyLang('enter_title')}}</span>
                    <a href="{{:MyUrl('index/order/index')}}" class="am-text-secondary">{{:MyLang('buy.payment_layer_order_button_text')}}</a>
                    <span>{{:MyLang('buy.payment_layer_tips')}}</span>
                </p>
            </div>
        </div>
    </div>
</div>

<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->

<script type="text/javascript">
// 提交订单回调
function BuySubmitBack(e)
{
    if(e.code == 0)
    {
        $('#buy-order-submit-modal').modal({
            closeViaDimmer: false,
            width: 280,
            height: 140
        });
        $.AMUI.progress.done();
        Prompt(e.msg, 'success');
        setTimeout(function()
        {
            window.location.href = e.data.jump_url;
        }, 1500);
    } else {
        $('form.form-validation').find('button[type="submit"]').button('reset');
        $.AMUI.progress.done();
        Prompt(e.msg);
    }
}
</script>
